home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-11 | 14.6 KB | 342 lines | [TEXT/MPS ] |
- ;
- ; File: Video.a
- ;
- ; Copyright: © 1984-1994 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__VIDEO__') = 'UNDEFINED' THEN
- __VIDEO__ SET 1
-
-
- IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
- include 'Quickdraw.a'
- ENDIF
- ; include 'Types.a' ;
- ; include 'ConditionalMacros.a' ;
- ; include 'MixedMode.a' ;
- ; include 'QuickdrawText.a' ;
-
- mBaseOffset EQU 1 ;Id of mBaseOffset.
- mRowBytes EQU 2 ;Video sResource parameter Id's
- mBounds EQU 3 ;Video sResource parameter Id's
- mVersion EQU 4 ;Video sResource parameter Id's
- mHRes EQU 5 ;Video sResource parameter Id's
- mVRes EQU 6 ;Video sResource parameter Id's
- mPixelType EQU 7 ;Video sResource parameter Id's
- mPixelSize EQU 8 ;Video sResource parameter Id's
- mCmpCount EQU 9 ;Video sResource parameter Id's
- mCmpSize EQU 10 ;Video sResource parameter Id's
- mPlaneBytes EQU 11 ;Video sResource parameter Id's
- mVertRefRate EQU 14 ;Video sResource parameter Id's
- mVidParams EQU 1 ;Video parameter block id.
- mTable EQU 2 ;Offset to the table.
- mPageCnt EQU 3 ;Number of pages
- mDevType EQU 4 ;Device Type
- oneBitMode EQU 128 ;Id of OneBitMode Parameter list.
- twoBitMode EQU 129 ;Id of TwoBitMode Parameter list.
- fourBitMode EQU 130 ;Id of FourBitMode Parameter list.
- eightBitMode EQU 131 ;Id of EightBitMode Parameter list.
-
- sixteenBitMode EQU 132 ;Id of SixteenBitMode Parameter list.
- thirtyTwoBitMode EQU 133 ;Id of ThirtyTwoBitMode Parameter list.
- firstVidMode EQU 128 ;The new, better way to do the above.
- secondVidMode EQU 129 ; QuickDraw only supports six video
- thirdVidMode EQU 130 ; at this time.
- fourthVidMode EQU 131
- fifthVidMode EQU 132
- sixthVidMode EQU 133
- spGammaDir EQU 64
- spVidNamesDir EQU 65
-
- ; csTimingFormat values in VDTimingInfo
- ; look in the declaration rom for timing info
- kDeclROMtables EQU 'decl'
-
- ; Timing mode constants for Display Manager MultiMode support
- ; Corresponding .h equates are in Video.h
- ; .a equates are in Video.a
- ; .r equates are in DepVideoEqu.r
- ;
- timingInvalid EQU 0 ; Unknown timing… force user to confirm.
- timingApple12 EQU 130 ; 512x384 (60 Hz) Rubik timing.
- timingApple12x EQU 135 ; 560x384 (60 Hz) Rubik-560 timing.
- timingApple13 EQU 140 ; 640x480 (67 Hz) HR timing.
- timingApple13x EQU 145 ; 640x400 (67 Hz) HR-400 timing.
- timingAppleVGA EQU 150 ; 640x480 (60 Hz) VGA timing.
- timingApple15 EQU 160 ; 640x870 (75 Hz) FPD timing.
- timingApple15x EQU 165 ; 640x818 (75 Hz) FPD-818 timing.
- timingApple16 EQU 170 ; 832x624 (75 Hz) GoldFish timing.
- timingAppleSVGA EQU 180 ; 800x600 (56 Hz) SVGA timing.
- timingApple1Ka EQU 190 ; 1024x768 (60 Hz) VESA 1K-60Hz timing.
- timingApple1Kb EQU 200 ; 1024x768 (70 Hz) VESA 1K-70Hz timing.
- timingApple19 EQU 210 ; 1024x768 (75 Hz) Apple 19" RGB.
- timingApple21 EQU 220 ; 1152x870 (75 Hz) Apple 21" RGB.
- timingAppleNTSC_ST EQU 230 ; 512x384 (60 Hz, interlaced, non-convolved).
- timingAppleNTSC_FF EQU 232 ; 640x480 (60 Hz, interlaced, non-convolved).
- timingAppleNTSC_STconv EQU 234 ; 512x384 (60 Hz, interlaced, convolved).
- timingAppleNTSC_FFconv EQU 236 ; 640x480 (60 Hz, interlaced, convolved).
- timingApplePAL_ST EQU 238 ; 640x480 (50 Hz, interlaced, non-convolved).
- timingApplePAL_FF EQU 240 ; 768x576 (50 Hz, interlaced, non-convolved).
- timingApplePAL_STconv EQU 242 ; 640x480 (50 Hz, interlaced, non-convolved).
- timingApplePAL_FFconv EQU 244 ; 768x576 (50 Hz, interlaced, non-convolved).
-
- ; csConnectFlags values in VDDisplayConnectInfo
- kAllModesValid EQU 0 ; All modes not trimmed by primary init are good close enough to try
- kAllModesSafe EQU 1 ; All modes not trimmed by primary init are know to be safe
- kReportsTagging EQU 2 ; Can detect tagged displays (to identify smart monitors)
- kHasDirectConnection EQU 3 ; True implies that driver can talk directly to device (e.g. serial data link via sense lines)
- kIsMonoDev EQU 4 ; Says whether there’s an RGB (0) or Monochrome (1) connection.
- kUncertainConnection EQU 5 ; There may not be a display (no sense lines?).
- kReservedConnectionBit EQU 6 ; Reserved for now
- kReportsDDCConnection EQU 7 ; Card can do ddc (set kHasDirectConnect && kHasDDCConnect if you actually found a ddc display).
- kHasDDCConnection EQU 8 ; Card has ddc connect now.
-
- ; csDisplayType values in VDDisplayConnectInfo
- kUnknownConnect EQU 1 ; Not sure how we’ll use this, but seems like a good idea.
- kPanelConnect EQU 2 ; For use with fixed-in-place LCD panels.
- kPanelTFTConnect EQU 2 ; Alias for kPanelConnect
- kFixedModeCRTConnect EQU 3 ; For use with fixed-mode (i.e., very limited range) displays.
- kMultiModeCRT1Connect EQU 4 ; 320x200 maybe, 12" maybe, 13" (default), 16" certain, 19" maybe, 21" maybe
- kMultiModeCRT2Connect EQU 5 ; 320x200 maybe, 12" maybe, 13" certain, 16" (default), 19" certain, 21" maybe
- kMultiModeCRT3Connect EQU 6 ; 320x200 maybe, 12" maybe, 13" certain, 16" certain, 19" default, 21" certain
- kMultiModeCRT4Connect EQU 7 ; Expansion to large multi mode (not yet used)
- kModelessConnect EQU 8 ; Expansion to modeless model (not yet used)
- kFullPageConnect EQU 9 ; 640x818 (to get 8bpp in 512K case) and 640x870 (these two only)
- kVGAConnect EQU 10 ; 640x480 VGA default -- question everything else
- kNTSCConnect EQU 11 ; NTSC ST (default), FF, STconv, FFconv
- kPALConnect EQU 12 ; PAL ST (default), FF, STconv, FFconv
- kHRConnect EQU 13 ; 640x400 (to get 8bpp in 256K case) and 640x480 (these two only)
- kPanelFSTNConnect EQU 14 ; For use with fixed-in-place LCD FSTN (aka “Supertwist”) panels
-
- ; csTimingFlags values in VDTimingInfoRec
- kModeValid EQU 0 ; Says that this mode should NOT be trimmed.
- kModeSafe EQU 1 ; This mode does not need confirmation
- kModeDefault EQU 2 ; This is the default mode for this type of connection
- kModeShowNow EQU 3 ; This mode should always be shown (even though it may require a confirm)
- kModeNotResize EQU 4 ; This mode should not be used to resize the display (eg. mode selects a different connector on card)
-
- ; Control Codes
- cscReset EQU 0
- cscKillIO EQU 1
- cscSetMode EQU 2
- cscSetEntries EQU 3
- cscSetGamma EQU 4
- cscGrayPage EQU 5
- cscGrayScreen EQU 5
- cscSetGray EQU 6
- cscSetInterrupt EQU 7
- cscDirectSetEntries EQU 8
- cscSetDefaultMode EQU 9
- cscSwitchMode EQU 10
- cscSetSync EQU 11
- cscSavePreferredConfiguration EQU 16
-
- ; Status Codes
- cscGetMode EQU 2
- cscGetEntries EQU 3
- cscGetPageCnt EQU 4
- cscGetPages EQU 4 ; This is what C&D 2 calls it.
- cscGetPageBase EQU 5
- cscGetBaseAddr EQU 5 ; This is what C&D 2 calls it.
- cscGetGray EQU 6
- cscGetInterrupt EQU 7
- cscGetGamma EQU 8
- cscGetDefaultMode EQU 9
- cscGetCurMode EQU 10
- cscGetSync EQU 11
- cscGetConnection EQU 12 ; Return information about the connection to the display
- cscGetModeTiming EQU 13 ; Return timing info for a mode
- cscGetModeBaseAddress EQU 14 ; Return base address information about a particular mode
- cscGetScanProc EQU 15 ; QuickTime scan chasing routine
- cscGetPreferredConfiguration EQU 16
- cscGetNextResolution EQU 17
- cscGetVideoParameters EQU 18
- cscGetGammaList EQU 19
-
- ; Bit definitions for the Get/Set Sync call
- kHorizontalSyncDisableBit EQU 0
- kVerticalSyncDisableBit EQU 1
- kCompositeSyncDisableBit EQU 2
- kSyncOnRedEnableBit EQU 3
- kSyncOnGreenEnableBit EQU 4
- kSyncOnBlueEnableBit EQU 5
- kHorizontalSyncMask EQU $01
- kVerticalSyncMask EQU $02
- kCompositeSyncMask EQU $04
- kDPMSSyncMask EQU $7
- kSyncOnRedMask EQU $08
- kSyncOnGreenMask EQU $10
- kSyncOnBlueMask EQU $20
- kSyncOnMask EQU $38
-
- VPBlock RECORD 0
- vpBaseOffset ds.l 1 ;Offset to page zero of video RAM (From minorBaseOS).
- vpRowBytes ds.w 1 ;Width of each row of video memory.
- vpBounds ds Rect ;BoundsRect for the video display (gives dimensions).
- vpVersion ds.w 1 ;PixelMap version number.
- vpPackType ds.w 1
- vpPackSize ds.l 1
- vpHRes ds.l 1 ;Horizontal resolution of the device (pixels per inch).
- vpVRes ds.l 1 ;Vertical resolution of the device (pixels per inch).
- vpPixelType ds.w 1 ;Defines the pixel type.
- vpPixelSize ds.w 1 ;Number of bits in pixel.
- vpCmpCount ds.w 1 ;Number of components in pixel.
- vpCmpSize ds.w 1 ;Number of bits per component
- vpPlaneBytes ds.l 1 ;Offset from one plane to the next.
- sizeof EQU 42
- ENDR
-
- VDEntryRecord RECORD 0
- csTable ds.l 1 ;(long) pointer to color table entry=value, r,g,b:INTEGER
- sizeof EQU 4
- ENDR
-
- ; Parm block for SetGray control call
- VDGrayRecord RECORD 0
- csMode ds.b 1 ;Same as GDDevType value (0=mono, 1=color)
- filler ds.b 1
- sizeof EQU 2
- ENDR
-
- ; Parm block for SetEntries control call
- VDSetEntryRecord RECORD 0
- csTable ds.l 1 ;Pointer to an array of color specs
- csStart ds.w 1 ;Which spec in array to start with, or -1
- csCount ds.w 1 ;Number of color spec entries to set
- sizeof EQU 8
- ENDR
-
- ; Parm block for SetGamma control call
- VDGammaRecord RECORD 0
- csGTable ds.l 1 ;pointer to gamma table
- sizeof EQU 4
- ENDR
-
- VDSwitchInfoRec RECORD 0
- csMode ds.w 1 ;(word) mode depth
- csData ds.l 1 ;(long) functional sResource of mode
- csPage ds.w 1 ;(word) page to switch in
- csBaseAddr ds.l 1 ;(long) base address of page (return value)
- csReserved ds.l 1 ;(long) Reserved (set to 0)
- sizeof EQU 16
- ENDR
-
- VDTimingInfoRec RECORD 0
- csTimingMode ds.l 1 ; LONGINT - (long) timing mode (a la InitGDevice)
- csTimingReserved ds.l 1 ; LONGINT - (long) reserved
- csTimingFormat ds.l 1 ; LONGINT - (long) what format is the timing info
- csTimingData ds.l 1 ; LONGINT - (long) data supplied by driver
- csTimingFlags ds.l 1 ; LONGINT - (long) mode within device
- sizeof EQU 20
- ENDR
-
- VDDisplayConnectInfoRec RECORD 0
- csDisplayType ds.w 1 ; INTEGER - (word) Type of display connected
- csConnectTagged ds.w 1 ; INTEGER - (word) Display is currently "it" (tagged to identify component)
- csConnectFlags ds.l 1 ; LONGINT - (long) tell us about the connection
- csDisplayComponent ds.l 1 ; LONGINT - (long) if the card has a direct connection to the display, it returns the display component here (FUTURE)
- csConnectReserved ds.l 1 ; LONGINT - (long) reserved
- sizeof EQU 16
- ENDR
-
- VDPageInfo RECORD 0
- csMode ds.w 1 ;(word) mode within device
- csData ds.l 1 ;(long) data supplied by driver
- csPage ds.w 1 ;(word) page to switch in
- csBaseAddr ds.l 1 ;(long) base address of page
- sizeof EQU 12
- ENDR
-
- VDSizeInfo RECORD 0
- csHSize ds.w 1 ;(word) desired/returned h size
- csHPos ds.w 1 ;(word) desired/returned h position
- csVSize ds.w 1 ;(word) desired/returned v size
- csVPos ds.w 1 ;(word) desired/returned v position
- sizeof EQU 8
- ENDR
-
- VDSettings RECORD 0
- csParamCnt ds.w 1 ;(word) number of params
- csBrightMax ds.w 1 ;(word) max brightness
- csBrightDef ds.w 1 ;(word) default brightness
- csBrightVal ds.w 1 ;(word) current brightness
- csCntrstMax ds.w 1 ;(word) max contrast
- csCntrstDef ds.w 1 ;(word) default contrast
- csCntrstVal ds.w 1 ;(word) current contrast
- csTintMax ds.w 1 ;(word) max tint
- csTintDef ds.w 1 ;(word) default tint
- csTintVal ds.w 1 ;(word) current tint
- csHueMax ds.w 1 ;(word) max hue
- csHueDef ds.w 1 ;(word) default hue
- csHueVal ds.w 1 ;(word) current hue
- csHorizDef ds.w 1 ;(word) default horizontal
- csHorizVal ds.w 1 ;(word) current horizontal
- csHorizMax ds.w 1 ;(word) max horizontal
- csVertDef ds.w 1 ;(word) default vertical
- csVertVal ds.w 1 ;(word) current vertical
- csVertMax ds.w 1 ;(word) max vertical
- sizeof EQU 38
- ENDR
-
-
- kFirstDepthMode EQU 128
- kSecondDepthMode EQU 129
- kThirdDepthMode EQU 130
- kFourthDepthMode EQU 131
- kFifthDepthMode EQU 132
- kSixthDepthMode EQU 133
-
- VDResolutionInfoRec RECORD 0
- csPreviousDisplayModeID ds.l 1 ; ID of the previous resolution in a chain
- csDisplayModeID ds.l 1 ; ID of the next resolution
- csHorizontalPixels ds.l 1 ; # of pixels in a horizontal line
- csVerticalLines ds.l 1 ; # of lines in a screen
- csRefreshRate ds.l 1 ; Vertical Refresh Rate in Hz
- csMaxDepthMode ds.w 1 ; 0x80-based number representing max bit depth
- csReserved ds.l 1 ; Reserved
- csReserved1 ds.l 1 ; Reserved
- sizeof EQU 30
- ENDR
-
- VDVideoParametersInfoRec RECORD 0
- csDisplayModeID ds.l 1 ; the ID of the resolution we want info on
- csDepthMode ds.w 1 ; The bit depth we want the info on (0x80 based)
- csVPBlockPtr ds.l 1 ; Pointer to a video parameter block
- csPageCount ds.l 1 ; Number of pages supported by the resolution
- csDeviceType ds.l 1 ; Device Type: Direct, Fixed or CLUT;
- csReserved ds.l 1 ; Reserved
- sizeof EQU 22
- ENDR
-
- VDGammaInfoRec RECORD 0
- csLastGammaID ds.l 1 ; the ID of the previous gamma table
- csNextGammaID ds.l 1 ; the ID of the next gamma table
- csGammaPtr ds.l 1 ; Ptr to a gamma table data
- csReserved ds.l 1 ; Reserved
- sizeof EQU 16
- ENDR
-
- VDDefMode RECORD 0
- csID ds.b 1
- filler1 ds.b 1
- sizeof EQU 2
- ENDR
-
- VDSyncInfoRec RECORD 0
- csMode ds.b 1
- csFlags ds.b 1
- sizeof EQU 2
- ENDR
-
- ENDIF ; __VIDEO__
-